<?php
require_once './include/init.php';
require_once './core/pro.php';
require_once './core/cate.php';
require_once './core/thumb.php';
//print_r($_SESSION);
$res=getallgoodcate();








?>
<html>
<head>
<meta charset="utf-8">
<title>首页</title>
<link type="text/css" rel="stylesheet" href="./admin/styles/reset.css">
<link type="text/css" rel="stylesheet" href="./admin/styles/main.css">
<!--[if IE 6]>
<script type="text/javascript" src="js/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript" src="js/ie6Fixpng.js"></script>
<![endif]-->
</head>
<body>
<div class="headerBar">
    <div class="topBar">
        <div class="comWidth">
            <div class="leftArea">
                <a href="#" class="collection">收藏清新</a>
            </div>
            <div class="rightArea">
            欢迎来到清新网!
             <?php
                if(isset($_SESSION['username'])|| isset($_COOKIE['username'])){

     $username=isset($_SESSION['username'])?$_SESSION['username']:$_COOKIE['username'];
                    ?>
                <span>欢迎您</span><?php echo $username;
                ?><a href="doAction.php?act=userOut">[退出]</a>
                <?php }else{
     ?>
     <a href="login.php">[登录]</a><a href="reg.php">[免费注册]</a>
                            <?php }?>
        </div>
    </div>
    <div class="logoBar">
        <div class="comWidth">
            <div class="logo fl">
                <a href="#"><img src="/admin/images/logo%20%281%29.jpg" alt="清新网"></a>
            </div>
            <div class="search_box fl">
                <input type="text" class="search_text fl">
                <input type="button" value="搜 索" class="search_btn fr">
            </div>
            <div class="shopCar fr">
                <span class="shopText fl">购物车</span>
                <span class="shopNum fl">0</span>
            </div>
        </div>
    </div>
    <div class="navBox">
        <div class="comWidth clearfix">
            <div class="shopClass fl">
                <h3>全部商品分类<i class="shopClass_icon"></i></h3>
                <div class="shopClass_show">
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                    <dl class="shopClass_item">
                        <dt><a href="#" class="b">手机</a> <a href="#" class="b">数码</a> <a href="#" class="aLink">合约机</a></dt>
                        <dd><a href="#">荣耀3X</a> <a href="#">单反</a> <a href="#">智能设备</a></dd>
                    </dl>
                </div>
                <div class="shopClass_list hide">
                    <div class="shopClass_cont">
                        <dl class="shopList_item">
                            <dt>电脑装机</dt>
                            <dd>
                                <a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a>
                            </dd>
                        </dl>
                        <dl class="shopList_item">
                            <dt>电脑装机</dt>
                            <dd>
                                <a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a><a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a><a href="#">文字啊</a>
                            </dd>
                        </dl>
                        <dl class="shopList_item">
                            <dt>电脑装机</dt>
                            <dd>
                                <a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a><a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a><a href="#">文字啊</a>
                            </dd>
                        </dl>
                        <dl class="shopList_item">
                            <dt>电脑装机</dt>
                            <dd>
                                <a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a><a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a><a href="#">文字啊</a>
                            </dd>
                        </dl>
                        <dl class="shopList_item">
                            <dt>电脑装机</dt>
                            <dd>
                                <a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a><a href="#">文字啊</a><a href="#">文字字啊</a><a href="#">文字字字啊</a><a href="#">文字啊</a><a href="#">文字</a><a href="#">文字啊</a><a href="#">文字啊</a>
                            </dd>
                        </dl>
                        <div class="shopList_links">
                            <a href="#">文字测试内容等等<span></span></a><a href="#">文字容等等<span></span></a>
                        </div>
                    </div>
                </div>
            </div>
            <ul class="nav fl">
                <li><a href="#" class="active">数码城</a></li>
                <li><a href="#">天黑黑</a></li>
                <li><a href="#">团购</a></li>
                <li><a href="#">发现</a></li>
                <li><a href="#">二手特卖</a></li>
                <li><a href="#">名品会</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="banner comWidth clearfix">
    <div class="banner_bar banner_big">
        <ul class="imgBox">
            <li><a href="#"><img src="./admin/images/pp.jpg" alt="banner"></a></li>
            <li><a href="#"><img src="admin/images/banner_02.jpg" alt="banner"></a></li>
        </ul>
        <div class="imgNum">
            <a href="#" class="active"></a><a href="#"></a><a href="#"></a><a href="#"></a>
        </div>
    </div>
</div>
<?php foreach($res as $v){?><!--商品分类-->
<div class="shopTit comWidth">
    <span class="icon"></span><h3><?php echo $v['cate']?></h3>
    <a href="#" class="more">更多&gt;&gt;</a>
</div>
<div class="shopList comWidth clearfix">
    <div class="leftArea">
        <div class="banner_bar banner_sm">
            <ul class="imgBox">
                <li><a href="#"><img src="./admin/images/banner_sm_01.jpg" alt="banner"></a></li>
                <li><a href="#"><img src="images/banner/banner_sm_02.jpg" alt="banner"></a></li>
            </ul>
            <div class="imgNum">
                <a href="#" class="active"></a><a href="#"></a><a href="#"></a><a href="#"></a>
            </div>
        </div>
    </div>
    <div class="rightArea">
     <?php
     $goods4=getGood4($v['id']);
     $goods8=getGood8($v['id']);


  ?>
        <div class="shopList_top clearfix">
        <?php
        foreach ($goods4 as $vv)//获取商品ID
        {
            $img=getOneImageNameByPid($vv['id']);//获取图片名字
        ?>
                    <div class="shop_item">
                <div class="shop_img">
                    <a href="proDetails.php?id=<?php echo $vv['id'];?>" target="_blank"><img height="200" width="187" src="uploads/800/<?php echo $img;?>" alt=""></a>
                </div>
                <h3><?php echo $vv['pName']?></h3>
                <p><?php echo $vv['mPrice']?></p>
            </div>

            <?php }?>

        </div>

        <div class="shopList_sm clearfix">
         <?php
        foreach ($goods8 as $vvv)
        {
            $img=getOneImageNameByPid($vvv['id']);

        ?>
                    <div class="shopItem_sm">
                <div class="shopItem_smImg">
                    <a href="proDetails.php?id=<?php echo $vvv['id'];?>" target="_blank"><img width="95" height="95" src="uploads/300/<?php echo $img;?>" alt=""></a>
                </div>
                <div class="shopItem_text">
                    <p><?php echo $vvv['mPrice']?></p>
                    <h3><?php echo $vvv['pName']?></h3>
                </div>
            </div>

             <?php }?>
            </div>

                    </div>
    </div>
</div>

<?php }?>
<div class="hr_25"></div>
<div class="footer">
    <p><a href="#">清新简介</a><i>|</i><a href="#">清新公告</a><i>|</i> <a href="#">招纳贤士</a><i>|</i><a href="#">联系我们</a><i>|</i>客服热线：400-675-1234</p>
    <p>Copyright &copy; 2006 - 2014 清新版权所有&nbsp;&nbsp;&nbsp;京ICP备09037834号&nbsp;&nbsp;&nbsp;京ICP证B1034-8373号&nbsp;&nbsp;&nbsp;某市公安局XX分局备案编号：123456789123</p>
    <p class="web"><a href="#"><img src="images/webLogo.jpg" alt="logo"></a><a href="#"><img src="images/webLogo.jpg" alt="logo"></a><a href="#"><img src="images/webLogo.jpg" alt="logo"></a><a href="#"><img src="images/webLogo.jpg" alt="logo"></a></p>
</div>
</body>
</html>
